<extend name="Public:innerbase" />

<block name="js">

<script src="{:RES}/js/date/WdatePicker.js"></script>

</block>

<block name="content">

<div class="container-fluid">

	<ul class="nav nav-tabs wm-tabs">

		<li class="active"><a href="javascript:void(0)">修改信息</a></li>
 
		<!--<li><a href="{:U('Member/xuorder')}">虚拟盘流水记录</a></li>-->
<!-- 
		<li><a href="{:U('Member/orderstats')}">流水统计</a></li> -->

	</ul>

	<div class="page-header wm-page-header">
<!-- 
	<form method="get" action="__SELF__" class="form-inline">
	 			<label>WechatID</label>
	 			<input name="wechat_name" type="text" value="{$_GET['wechat_name']}" class="form-control" />
	 			<button class="btn btn-primary" type="submit">
	 				<span class="glyphicon glyphicon-search"></span>
	 				查询
	 			</button>
	 			</form> 

	</div>
 -->
 <style type="text/css">
 .infoth{
 	background: white !important;
 }
 .infoth input{
	border: 1px solid rgb(230,230,230);
	width: 100%;
	max-width: 300px;
 }
 .infoth b{
 	color: rgb(200,200,200);font-weight: normal;padding-left: 10px;
 }
 </style>
	<TABLE class="table wm-table-bordered table-striped table-hover">

		<THEAD>

		<TR>

			<TH width='10%'>订单号</TH>	
			<TH class='infoth' >{$info.orderid}</TH>
		</TR>

		<TR>

			<TH>WechatID</TH>	
			<TH class='infoth' >{$info.open_id}</TH>

		</TR>

		<TR>

			<TH>姓名</TH>	
			<TH class='infoth' >{$info.username}</TH>

		</TR>

		<TR>

			<TH>手机号码</TH>	
			<TH class='infoth' >{$info.phonenum}</TH>

		</TR>

		<TR>

			<TH>发货区域</TH>	
			<TH class='infoth' >{$info.area}</TH>

		</TR>

		<TR>

			<TH>详细地址</TH>	
			<TH class='infoth' >{$info.address}</TH>

		</TR>

		<TR>

			<TH>奖品名</TH>	
			<TH class='infoth' >{$info.prizename}</TH>

		</TR>

		<TR>

			<TH>发货状态</TH>	
			<TH class='infoth'>
				<select id='deliverystat'>
				  <if condition="$info['deliverystat'] eq 0">
				  	<option value ="0" selected="selected">未发货</option>
				  <else/>
				  	<option value ="0">未发货</option>
				  </if>
				  <if condition="$info['deliverystat'] eq 1">
				  	<option value ="1" selected="selected">已发货</option>
				  <else/>
				  	<option value ="1">已发货</option>
				  </if>
				  <if condition="$info['deliverystat'] eq -1">
				  	<option value="-1" selected="selected">取消发货</option>
				  <else/>
				  	<option value="-1">取消发货</option>
				  </if>
				</select>
				<b>*修改发货状态 (发货时间以发货状态为已发货为准)</b>
			</TH>

		</TR>

		<TR>

			<TH>快递单号</TH>	
			<TH class='infoth' >
				<input type="text" id='tracknum' name="tracknum">
			</TH>

		</TR>


		</THEAD>


	</TABLE>
	<span style='width: 120px;left: 50%;margin-left:-140px;margin-top: 20px;' class="btn submit_btn btn-primary" >
	 	修改
	</span>
	<span style='width: 120px;left: 50%;margin-left:40px;margin-top: 20px;background: white;color: rgb(120,120,120);' class="btn back_btn btn-primary" >
	 	返回
	</span>
	<script>
	$(function(){
		$('.submit_btn').on('click',function(){
			var tracknum = $('#tracknum').val();
			var deliverystat = $('#deliverystat').val();
			//alert(deliverystat);
			$.ajax({
                type: "POST",
                url: "{:U('Member/orderedit')}",
                data: {
                	orderid:"{$info.orderid}",
                	tracknum:tracknum,
                	deliverystat:deliverystat,
                },
                dataType: "json",
                success: function(data){
                    if(data.success==1){
                    	alert('修改成功');
                    	window.location.href="{:U('Member/order')}";
                    }else{
                    	alert('修改失败:'+data.errorcode);
                    }
                }
            });
		});
		$('.back_btn').on('click',function(){
            window.location.href="{:U('Member/order')}";
		});
		
	})
	</script>
</div>

</block>